package com.lagou.seckill.mvc.web;

import com.lagou.seckill.dto.Response;
import com.lagou.seckill.mvc.service.OrderService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
public class OrderController {

    final OrderService orderService;

    @PostMapping("order/{commodityId}")
    public Response order(@PathVariable String commodityId) {
        return orderService.order(commodityId);
    }

}
